# -*- coding: utf-8 -*-
"""
Created on Thu Dec  3 14:42:16 2020

@author: Think
"""

# v= np.var(y1+y2)
# e= np.dot((np.array(y1)-np.array(c1)),(np.array(y1)-np.array(c1)))/40
# s=e/v
# print(s)


# all_avail_result_a =[[0.9997388650820653, 0.9997176453937303, 0.9997248072968807, 0.9997644754992215, 0.99974341303715, 0.9997439517500528, 0.9997321339194666, 0.9997355708543562, 0.9997433623438963, 0.9997654717810285, 0.9997301451567908, 0.9997286118903862, 0.9997420196616583, 0.9997364356734476, 0.9997377306981289, 0.9997436858255633, 0.9997491827545294, 0.9997272084783624, 0.9997419260032663, 0.9997476844548189], [0.9997666303185945, 0.9997492428160245, 0.999750285601714, 0.999729865822495, 0.9997525366726301, 0.9997545338159384, 0.9997335752739596, 0.999769333618405, 0.9997504732082896, 0.9997503842140527, 0.9997617809506392, 0.9997542431011017, 0.9997527059634861, 0.9997456132815508, 0.999748491295251, 0.9997380007073576, 0.9997368044132092, 0.999757344037307, 0.999738856118881, 0.9997647429172587], [0.9997343378320042, 0.9997471309779493, 0.9997467929511195, 0.9997380265882111, 0.9997430605149557, 0.999742082092277, 0.9997283052946601, 0.9997257716943393, 0.9997442602506095, 0.9997539061430438, 0.9997471294733604, 0.9997627645083017, 0.9997258770933596, 0.9997558701903162, 0.9997619979577747, 0.9997527685128825, 0.9997300661837333, 0.9997388510289862, 0.9997192480108366, 0.9997365938056199], [0.9997275799225289, 0.9997588676594248, 0.9997293338949177, 0.9997380878651322, 0.9997280998722831, 0.9997298598010274, 0.9997576139859577, 0.9997428296943944, 0.9997407925558842, 0.9997387589445443, 0.9997500475781118, 0.9997413178516757, 0.9997556767348422, 0.999744301319123, 0.9997392872166501, 0.9997575890173609, 0.9997366363533634, 0.999759301557567, 0.9997298040140588, 0.9997561617929885], [0.9997444102301458, 0.9997265661245163, 0.9997257980619956, 0.9997450994811113, 0.9997456756366384, 0.9997263784250415, 0.9997338639682382, 0.9997368132125897, 0.9997590197226023, 0.9997306142726934, 0.9997328620002118, 0.9997448641564229, 0.9997545719467731, 0.9997424232874947, 0.9997539169531093, 0.9997436562968173, 0.9997423937343555, 0.9997561496508903, 0.999737209724356, 0.9997482792954863], [0.9997501075401941, 0.9997283002927356, 0.999741427812475, 0.999731542498182, 0.999735057690898, 0.9997445567503422, 0.999748013136314, 0.9997506754458894, 0.9997357102064863, 0.9997401864177271, 0.9997517573160198, 0.9997524564956953, 0.999746984804085, 0.999759005870372, 0.9997408198142625, 0.9997261948102163, 0.9997285718979673, 0.9997410340245817, 0.9997415647069832, 0.9997371467959181], [0.9997518636429252, 0.9997334153773824, 0.9997314811299326, 0.999751026231573, 0.999742180002406, 0.9997325640522008, 0.9997614468822914, 0.9997209077867774, 0.9997321124116205, 0.999749700135875, 0.9997398285636624, 0.999742602897607, 0.9997591155409044, 0.9997361266260874, 0.9997212174053561, 0.9997190373091703, 0.9997577109815721, 0.9997292887912438, 0.999748444307466, 0.9997216743677434], [0.9997418977035687, 0.9997211889655189, 0.9997131620471962, 0.9997255841948341, 0.9997409173227629, 0.9997334048987664, 0.9997527944857066, 0.9997445003771158, 0.9997484284058477, 0.9997269421419935, 0.9997393830512148, 0.9997458388203543, 0.999737597019766, 0.9997664777606236, 0.9997432965797547, 0.9997249250863378, 0.9997634634404311, 0.9997322367912908, 0.9997569181599563, 0.9997312334789104], [0.9997385490581473, 0.999751595323286, 0.9997216503079963, 0.9997300648168488, 0.9997263699739248, 0.9997349416931108, 0.9997440332158469, 0.9997499121954943, 0.9997437781787869, 0.9997453057427435, 0.9997347126792652, 0.9997373365771923, 0.999716405832895, 0.9997272240705868, 0.9997450854480858, 0.9997347526233866, 0.9997552615767961, 0.9997158648111452, 0.9997414609658769, 0.9997187893401638], [0.999754111005842, 0.9997595823458701, 0.9997359041100637, 0.9997429387011205, 0.9997471034414912, 0.9997272035112914, 0.9997492112954938, 0.999731526684209, 0.9997281485868315, 0.9997324703136392, 0.9996993359317576, 0.9997409210337197, 0.9997518608662816, 0.9997621031289087, 0.9997357240951409, 0.9997564127723519, 0.9997383920071939, 0.9997225932807805, 0.9997469560421568, 0.9997328726069277], [0.9997318956483997, 0.999769545657109, 0.9997258384179148, 0.9997321119053467, 0.9997318292112268, 0.999732198875132, 0.9997447814552166, 0.9997553523898525, 0.9997500337797721, 0.999715036343557, 0.9997692302670917, 0.999747835453425, 0.9997405292790844, 0.9997377991168627, 0.9997525360463855, 0.9997403146141656, 0.9997502834656017, 0.9997341417055658, 0.9997481224386288, 0.9997616473389646], [0.9997290667623564, 0.9997614715739978, 0.9997247070163674, 0.9997352714258043, 0.9997313580874442, 0.999752510790192, 0.9997561815689447, 0.9997435639031288, 0.9997603266645535, 0.9997104222661486, 0.9997295582725111, 0.99973823035487, 0.9997421379331102, 0.9997474286173982, 0.9997650132087368, 0.9997457212322451, 0.9997371931339469, 0.9997203733602881, 0.9997384067746248, 0.9997552401859723], [0.999717835836976, 0.9997197254997571, 0.9997299972077268, 0.99973231242166, 0.9997387390320912, 0.9997478225187144, 0.9997344043918959, 0.9997495781457734, 0.9997479082990562, 0.999752169879206, 0.9997409712926975, 0.999747057541413, 0.9997371218615294, 0.9997619831329898, 0.9997488350828644, 0.9997637636745411, 0.9997286409836939, 0.9997289210520595, 0.9997377467137442, 0.9997499511618223], [0.9997376351121574, 0.9997533570938867, 0.9997384804579309, 0.9997195731147833, 0.9997460377287752, 0.9997598986277739, 0.999749678428629, 0.9997510575820424, 0.9997626955187178, 0.999736153204836, 0.999747918478268, 0.999728303726103, 0.9997525476452691, 0.9997443200889097, 0.999724419975076, 0.9997338266216746, 0.9997329174207128, 0.9997553320292031, 0.9997609132997569, 0.9997072693129438], [0.999740760436285, 0.9997351923042802, 0.9997462338378823, 0.9997439998329279, 0.9997265979437471, 0.9997477290969546, 0.999735957257909, 0.9997297180997965, 0.9997303103855115, 0.9997645884761925, 0.999739212783581, 0.9997540103549718, 0.9997674727835786, 0.9997389687134013, 0.9997545635750835, 0.9997562728861054, 0.9997442131834395, 0.9997399621174948, 0.9997199062884375, 0.9997465849406766], [0.9997416073571734, 0.9997498066185939, 0.9997491026691762, 0.9997414974027754, 0.9997222577312391, 0.999747420669747, 0.9997621523146552, 0.9997423114458228, 0.9997416008818285, 0.9997237186164576, 0.9997605512526416, 0.9997431292124617, 0.9997442823855351, 0.9997176803585016, 0.9997318046640244, 0.9997458600769193, 0.9997591937491142, 0.9997471537170499, 0.9997441140917581, 0.9997258658056549]]
# all_avail_result_b =[[0.9997377093181528, 0.9997597049344717, 0.999723197815964, 0.9997437539131678, 0.9997555342774505, 0.9997409366040523, 0.9997179762373927, 0.9997246055080651, 0.9997397986484526, 0.9997708746233063, 0.9997354465065249, 0.9997299004348124, 0.9997527172607328, 0.9997566567439002, 0.9997595048805071, 0.999751677307421, 0.9997402057469594, 0.9997398770936476, 0.9997495034908492, 0.9997408367729643]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# sin_index_1 = []
# sin_index_2 = []
# for i in range(1,len(all_avail_result_a)):
#     y1 = all_avail_result_a[0]
#     y2 = all_avail_result_b[0]
#     c1 = all_avail_result_a[i]
#     #c2 = all_avail_result_b[i]
#     v= np.var(y1+y2)
#     e= np.dot((np.array(y1)-np.array(c1)),(np.array(y1)-np.array(c1)))/40
#     s1= e/v
#     sin_index_1.append(s1)
# print("全效应指数为：",sin_index_1)

sx_1 = [0.6426775196138436, 1.383940227056955, 0.9897141930595513, 0.9862581903188197, 0.6919653863807537,
        1.4620596425290866, 0.9903269264585476, 0.9892490474956452, 1.292755709372928, 0.9436434520013798,
        1.4917069249934505, 0.8836961406911403, 0.9300417275119067, 1.1589587963034147, 1.2015333065105047]
sx_2 = [0.8826673034860276, 1.1806370326378823, 0.8871881648976663, 0.996505924449382, 1.2240730501312072,
        1.4674797556147827, 0.9226509082058831, 1.3479372754573995, 1.0167495671110514, 1.058776631070544,
        1.8520720893689175, 0.9267960606172764, 0.684579325092654, 1.1030380937473316, 1.5053574105882122]
new_sx1 = [x / sum(sx_1) for x in sx_1]
print(new_sx1)
new_sx2 = [x / sum(sx_2) for x in sx_2]
print(new_sx2)
